//List2D
// storage of 2D arrays
// contains a list of list1D arrays
// contains a list of Strings identifying the row numbers


#ifndef LIST2D
#define LIST2D

#include "stdafx.h"
//using namespace std;
class list2d
{
private:
	
public:
	std::vector <string> var_id;
	std::vector <string> row_id;
	std::map<  string, std::vector <double> > var;
	unsigned int nrows;
	unsigned int ncols;
	double nodata;
	string file;
	list2d();
	list2d(string root,string name); // allocates a list2d (size given in datafile) and reads all nessecary data into a file
	list2d(vector<string> irow_id,vector<string> ivar_id, double nodata);
	~list2d();
	int print();
	int write();
	int get_pos_of_first_entry (string row_idstring);
	int get_pos_of_last_entry (string row_idstring);
	int test_for_variable(string col_idstring);
	double get_val(const string idstring,unsigned int row);
	vector <string> get_key();
	list2d& operator=(const list2d &source);
	int pop_back();
};
#endif